package com.xxl.job.executor.config.listener;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.event.EventListener;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

/**
 * 基于spring 的监听者模式
 */

@Component
@Slf4j
public class LearnMyListener {

  @EventListener(LearnMyEvent.class)
  @Order(101)
  public void dealMyEvent1(LearnMyEvent event) {
    log.info("监听器1（101）--" + event.getSource().toString());
  }

  @EventListener(LearnMyEvent.class)
  @Order(102)
  public void dealMyEvent2(LearnMyEvent event) {
    log.info("监听器2（102）--" + event.getSource().toString());
  }
}
